home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 851 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: news.iag.net!news
  2. From: jatmon@iag.net (John R Buchan)
  3. Newsgroups: comp.lang.c,alt.msdos.programmer
  4. Subject: Re: Two strange C problems.
  5. Date: 9 Jan 1996 18:35:19 GMT
  6. Organization: Internet Access Group, Orlando, Florida
  7. Message-ID: <4cuch7$eod@news.iag.net>
  8. References: <4cojb2$qog@lugb.latrobe.edu.au> <4cqrom$a63@arcturus.ciril.fr>
  9. NNTP-Posting-Host: pm1-orl22.iag.net
  10. X-Newsreader: WinVN 0.99.7
  11.  
  12. In article <4cqrom$a63@arcturus.ciril.fr>, gross says...
  13. >For your second problem when you write "carac=15" then chr(carac) is the 
  14. ASCII
  15. >character of decimal value 15, ie the ASCII character 15. If you write
  16. >carac=\15, then chr(carac) is the ASCII character Hex(15), ie the ASCII
  17. >character 21.
  18. >
  19.  
  20. Assuming carac is type char:
  21.  
  22.    carac = \15; 
  23.  
  24. is an "Illegal character '\' (0x5c)" error message on my BC3.1 set to ansi.
  25.  
  26.  
  27. carac = '\15';  /* Sets carac to 15(octal) == 13(dec) == 0D(hex) */
  28.  
  29. carac = '\x15'; /* Sets carac to 15(hex) == 21(dec) == 25(octal) */
  30.  
  31. carac = 15;     /* Sets carac to 15(dec) == 0F(hex) == 17(octal) */
  32.  
  33. -- 
  34. John R Buchan           -:|:-     Looking for that elusive FAQ?  ftp to:
  35. jatmon@mail.iag.net     -:|:-     rtfm.mit.edu /pub/usenet-by-group/....
  36.  
  37.